source(here::here("code/load.R"))

lab <- "Holbein, Rangel, Moore, and Croft (2021)"

interest <- here("data/meta_analyses_raw/HolRanMooCro2021/study_comparison_interest_with_meta.csv") |>
    read_csv() |>
    # meta-analysis estimates; not individual studies
    filter(!is.na(variable_label)) |> 
    mutate(dv = "interest")

knowledge <- here("data/meta_analyses_raw/HolRanMooCro2021/study_comparison_knowledge_with_this_study_with_meta.csv") |>
    read_csv() |>
    # meta-analysis estimates; not individual studies
    filter(!is.na(variable_label)) |> 
    mutate(dv = "knowledge")   

full_join(interest, knowledge) |>
  mutate(meta_id = "HolRanMooCro2021",
         subfield = "CP",
         question = "Does voting increase political interest and political knowledge?",
         variable_label = case_when(variable_label == "This Study" ~ lab,
                                    is.na(variable_label) ~ lab,
                                    TRUE ~ variable_label),
         study_year = gsub(".*(\\d{4}).*", "\\1", variable_label),
         study_year = as.numeric(study_year),
         overall_effect = "no") |>
  select(meta_id,
         subfield,
         question,
         study_id = variable_label,
         study_year,
         estimate = late,
         std.error = se,
         dv,
         overall_effect) |>
  write_csv(here("data/meta_analyses_clean/HolRanMooCro2021.csv"))
